﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage/User.Master"
    CodeBehind="Payment.aspx.vb" Inherits="GoodAnotApp.Payment" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .alert
        {
            padding: 8px 35px 8px 14px;
            margin-bottom: 18px;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
            background-color: #fcf8e3;
            border: 1px solid #fbeed5;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            border-radius: 4px;
        }
        .alert, .alert-heading
        {
            color: #c09853;
        }
        .alert .close
        {
            position: relative;
            top: -5px;
            right: -21px;
            line-height: 18px;
        }
        .alert-success
        {
            background-color: #dff0d8;
            border-color: #d6e9c6;
        }
        .alert-success, .alert-success .alert-heading
        {
            color: #468847;
        }
        .alert-danger, .alert-error
        {
            background-color: #f2dede;
            border-color: #eed3d7;
        }
        .alert-danger, .alert-error, .alert-danger .alert-heading, .alert-error .alert-heading
        {
            color: #b94a48;
        }
        .alert-info
        {
            background-color: #d9edf7;
            border-color: #bce8f1;
        }
        .alert-info, .alert-info .alert-heading
        {
            color: #3a87ad;
        }
        .alert-block
        {
            padding-top: 14px;
            padding-bottom: 14px;
        }
        .alert-block > p, .alert-block > ul
        {
            margin-bottom: 0;
        }
        .alert-block p + p
        {
            margin-top: 5px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table style="width: 100%; margin-bottom: 0px">
        <tr>
            <td width="100%">
                <b style="color: #fe9901; font-size: 14pt">Payment for advertisement</b>
            </td>
        </tr>
        <tr>
            <td>
                <asp:ListView ID="lvPayment" runat="server" DataKeyNames="payment_ID" DataSourceID="SqlDataSourcePayment"
                    ViewStateMode="Inherit">
                    <EmptyDataTemplate>
                        <span>No payment required</span>
                    </EmptyDataTemplate>
                    <ItemTemplate>
                        <div id="divHeader" class="alert alert-error" style="padding-top: 4px; padding-bottom: 4px;
                            margin-bottom: 5px; width: 800px" runat="server">
                            <table style="margin-bottom: 0px; padding: 0px 0px 0px 0px; width: 100%">
                                <tr>
                                    <td style="border-top: 0px; padding: 3px 3px 3px 3px" width="610px">
                                        <b>Name : </b>
                                        <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                                    </td>
                                    <td style="border-top: 0px; padding: 3px 3px 3px 3px" width="120px">
                                        <b>Type : </b>
                                        <asp:Label ID="typeLabel" runat="server" Text='<%# Eval("type") %>' />
                                    </td>
                                    <td style="border-top: 0px; padding: 3px 3px 3px 3px" width="100px">
                                        <b>Cost : </b>
                                        <asp:Label ID="costLabel" runat="server" Text='<%# Eval("cost") %>' />
                                    </td>
                                    <td style="border-top: 0px; padding: 3px 3px 3px 3px" width="170px">
                                        <b>Make Payment : </b>
                                        <asp:CheckBox ID="cbPayment" runat="server" AutoPostBack="True" />
                                    </td>
                                </tr>
                            </table>
                            <asp:Label Visible="false" ID="payment_IDLabel" runat="server" Text='<%# Eval("payment_ID") %>' />
                            <asp:Label Visible="false" ID="user_IDLabel" runat="server" Text='<%# Eval("user_ID") %>' />
                            <asp:Label Visible="false" ID="adv_IDLabel" runat="server" Text='<%# Eval("adv_ID") %>' />
                        </div>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <div id="itemPlaceholderContainer" runat="server" style="">
                            <span runat="server" id="itemPlaceholder" />
                        </div>
                        <div style="">
                        </div>
                    </LayoutTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SqlDataSourcePayment" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                    SelectCommand="SELECT [payment_ID], [name], [user_ID], [cost], [type], [adv_ID] FROM [payment] WHERE ([user_ID] = @user_ID)">
                    <SelectParameters>
                        <asp:Parameter Name="user_ID" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td style="padding-left: 650px">
                Total Cost : $<asp:Label ID="lblTotalCost" runat="server"></asp:Label>
            </td>
            <td>
                <input type="hidden" name="cmd" value="_xclick" />
                <input type="hidden" name="business" value="lnx_1330061015_biz@live.com.sg" />
                <input type="hidden" name="lc" value="SG" />
                <input type="hidden" name="item_name" value="Advertisement" />
                <input type="hidden" name="amount" value="<%=hfPayment.value%>" />
                <input type="hidden" name="currency_code" value="SGD" />
                <input type="hidden" name="button_subtype" value="services" />
                <input type="hidden" name="tax_rate" value="0.000" />
                <input type="hidden" name="shipping" value="0.00" />
                <input type="hidden" name="notify_url" value="http://localhost:49798/paymentNotification.ashx" />
                <input type="hidden" name="return" value="home.aspx" />
                <input type="hidden" name="bn" value="PP-BuyNowBF:btn_paynow_SM.gif:NonHosted" />
                <a href="javascript:theForm.__VIEWSTATE.value='';theForm.encoding='application/x-www-form-urlencoded';theForm.action='https://www.sandbox.paypal.com/cgi-bin/webscr';theForm.submit();">
                    <img src="https://www.paypalobjects.com/en_GB/i/btn/btn_paynow_SM.gif" border="0"></a>
                <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif"
                    width="1" height="1" />
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hfPayment" runat="server" Value="0" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
